/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-03 14:14:47
 * Copyright (c) 2015- joysuch-版权所有
 */
package com.joysuch.wwyt.bp.repository;

import com.joysuch.wwyt.bp.entity.BpIndustrialPipeline;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;


/**
 * BpIndustrialPipelineDao
 *
 */
public interface BpIndustrialPipelineDao extends JpaRepository<BpIndustrialPipeline, Long>, QuerydslPredicateExecutor<BpIndustrialPipeline> {
    public Page<BpIndustrialPipeline> findAll(Specification<BpIndustrialPipeline> spec, Pageable pageable);

    public BpIndustrialPipeline save(BpIndustrialPipeline bean);

    public void delete(BpIndustrialPipeline bean);

    @Query("select id from BpIndustrialPipeline where code =?1")
    Long findIdByCode(String code);

    int countByCode(String code);

    BpIndustrialPipeline findByCode(String code);
}
